/*
 * session.h
 *
 *   Copyright 2010 Emediate ApS
 *
 *   This file is part of Stampede.
 *
 *   Stampede is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   Stampede is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with Stampede.  If not, see <http://www.gnu.org/licenses/>.
 *
 *   Written by: Erland Lewin <erland@emediate.se>
 *
 *  Created on: Dec 22, 2009
 */

#ifndef SESSION_H_
#define SESSION_H_

#include <libxml/xmlstring.h>

#include "transaction.h"

typedef struct sSession *Session;
typedef struct sHeader *Header;

Session session_create( const xmlChar *name, int headerCount, Header *headers,
                        int transactionCount, Transaction *transactions );

const xmlChar *session_getName( const Session session );
int session_getTransactionCount( const Session session );

Transaction session_getTransactionByIndex( const Session session, int index );

int session_getHeaderCount( const Session session );
const xmlChar *session_getHeaderStringByIndex( const Session session,
                                               int headerIndex );

Header header_create( const xmlChar *name, const xmlChar *value );

const xmlChar *header_getString( const Header header );

#endif /* SESSION_H_ */
